/***********************************************************************************/
/* Code license:  GNU General Public License v3                                    */
/* Main page:     https://code.google.com/p/library-cross-platform/                */
/* Issue tracker: https://code.google.com/p/library-cross-platform/issues/list     */
/***********************************************************************************/

#ifndef _VALUE_BY_REFERENCE_
#define _VALUE_BY_REFERENCE_

template<typename T> class vref {
  public:
    vref() {}
    vref(const vref<T>& v) { val = v.val; }
    vref(const T &v) : val(v) {}
    virtual ~vref(){};

    operator T&() const {
      return((T&)val);
    }

    operator vref<T>&() const {
      return(*this);
    }

  private:
    T val;
};

#endif //_VALUE_BY_REFERENCE_

/*
X(const X&);
X(X&);
X(const volatile X&);
X(volatile X&);
X(const X&, int = 10);
X(const X&, double = 1.0, int = 40);
*/
